# Git代理配置工具
# 默认代理参数
PROXY ?= 127.0.0.1
PORT ?= 7897

.PHONY: help set-proxy unset-proxy check-proxy

help:
	@echo "Git代理配置工具"
	@echo "make set-proxy   - 设置Git代理"
	@echo "make unset-proxy - 取消Git代理"
	@echo "make check-proxy - 查看当前代理设置"
	@echo "可以通过 PROXY=代理地址 PORT=端口 来自定义代理参数"

set-proxy:
	git config --global http.proxy http://$(PROXY):$(PORT)
	git config --global https.proxy http://$(PROXY):$(PORT)
	@echo "Git代理已设置为 http://$(PROXY):$(PORT)"

unset-proxy:
	git config --global --unset http.proxy
	git config --global --unset https.proxy
	@echo "Git代理已取消"

check-proxy:
	@echo "HTTP代理: $$(git config --get http.proxy)"
	@echo "HTTPS代理: $$(git config --get https.proxy)"
